using PssInput = Sce.Pss.Core.Input;

using Storyteller.Framework.Math;

namespace Storyteller.Framework.Input
{
	public class GamePad
	{
		public enum Button
		{
			None = 0,

			Cross = 128, Circle = 64, Square = 16, Triangle = 32,

			L = 1024, R = 2048,

			Start = 256, Select = 512,

			Up = 2, Down = 8, Left = 1, Right = 4	
		}

		public enum ThumbStick
		{
			Left, Right
		}
		
		public static bool IsButtonDown(int gamepadIndex, Button button)
		{
			if(gamepadIndex != 0)
				throw new System.ArgumentException("Only GamePad Index 0 is currently supported");
			return ((int)Game.Instance.GamePadData.Buttons & (int)button) == (int)button;
		}
	
		public static Vector2 GetThumbStickValue(int gamepadIndex, ThumbStick thumbStick)
		{
			if (thumbStick == ThumbStick.Left)
				return new Vector2(Game.Instance.GamePadData.AnalogLeftX,
					Game.Instance.GamePadData.AnalogLeftY);
			return new Vector2(Game.Instance.GamePadData.AnalogRightX,
				Game.Instance.GamePadData.AnalogRightY);
		}		
	}
}
